//
//  ToolMacro.h
//  ArtMedia
//
//  Created by 程明 on 2018/10/8.
//  Copyright © 2018年 程明. All rights reserved.
//

#ifndef ToolMacro_h
#define ToolMacro_h

#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;

#define LoginName  @"loginName"
#define LoginPSW   @"loginPSW"
#define COOKIE     @"UserDefaultsCookie"

#define AppRootViewController  [[[UIApplication sharedApplication] delegate] window].rootViewController
//提示
#define SHOWSUCCESS(str) \
[SVProgressHUD showSuccessWithStatus:str];\
[SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];\
[SVProgressHUD dismissWithDelay:1];

#define SHOWERROR(str) \
[SVProgressHUD showErrorWithStatus:str];\
[SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];\
[SVProgressHUD dismissWithDelay:1];

#define SHOWMSG(msg) \
[SVProgressHUD showInfoWithStatus:msg];\
[SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];\
[SVProgressHUD dismissWithDelay:1];

#define ALERTSHOW(msg) \
UIAlertView*alertView=[[UIAlertView alloc]initWithTitle:@"温馨提示" message:msg delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];\
[alertView show];


//获取RGB实现
#define RGBA(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define RGB(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(1.0)]

#define HexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
//适配iPhoneX
#define SafeAreaTopHeight (SCREEN_HEIGHT >= 812.0 ? 88 : 64)
#define SafeAreaBottomHeight (SCREEN_HEIGHT >= 812.0 ? 34 : 0)
#define SafeAreaStatuBarHeight (SCREEN_HEIGHT >= 812.0 ? 44 : 20)
#define SafeAreaValueHeight (SCREEN_HEIGHT >= 812.0 ? 24 : 0)

/**
 * 字体大小
 */

#define FontSize8  [UIFont systemFontOfSize:8.0]
#define FontSize9  [UIFont systemFontOfSize:9.0]
#define FontSize10 [UIFont systemFontOfSize:10.0]
#define FontSize11 [UIFont systemFontOfSize:11.0]
#define FontSize12 [UIFont systemFontOfSize:12.0]
#define FontSize13 [UIFont systemFontOfSize:13.0]
#define FontSize14 [UIFont systemFontOfSize:14.0]
#define FontSize15 [UIFont systemFontOfSize:15.0]
#define FontSize16 [UIFont systemFontOfSize:16.0]
#define FontSize18 [UIFont systemFontOfSize:18.0]

#define FontSize21 [UIFont systemFontOfSize:21.0]
#define FontSize30 [UIFont systemFontOfSize:30.0]

//加粗
#define FontBoldSystemSize11 [UIFont boldSystemFontOfSize:11.0]
#define FontBoldSystemSize12 [UIFont boldSystemFontOfSize:12.0]
#define FontBoldSystemSize13 [UIFont boldSystemFontOfSize:13.0]
#define FontBoldSystemSize14 [UIFont boldSystemFontOfSize:14.0]
#define FontBoldSystemSize15 [UIFont boldSystemFontOfSize:15.0]
#define FontBoldSystemSize18 [UIFont boldSystemFontOfSize:18.0]
#define FontBoldSystemSize16 [UIFont boldSystemFontOfSize:16.0]
#define FontBoldSystemSize30 [UIFont boldSystemFontOfSize:30.0]

#endif /* ToolMacro_h */
